//package com.linfeng.server.oauth.controller;
//
//
//import com.linfeng.component.common.response.ResponseEntity;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.oauth2.common.OAuth2AccessToken;
//import org.springframework.security.oauth2.provider.endpoint.TokenEndpoint;
//import org.springframework.web.HttpRequestMethodNotSupportedException;
//import org.springframework.web.bind.annotation.*;
//
//import java.security.Principal;
//import java.util.Map;
//
//@RestController
//@RequestMapping(value = "/oauth")
//public class OAuthController {
//
//    @Autowired
//    private TokenEndpoint tokenEndpoint;
//
//    @PostMapping(value = {"/token"})
//    public ResponseEntity<OAuth2AccessToken> postAccessToken(Principal principal, @RequestParam Map<String, String> parameters) throws HttpRequestMethodNotSupportedException {
//
//        return ResponseEntity.body(tokenEndpoint.postAccessToken(principal, parameters).getBody());
//    }
//}
